package com.tianji.chat.controller;


import com.tianji.chat.domain.dto.ChatDTO;
import com.tianji.chat.service.IChatHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 聊天记录表 前端控制器
 * </p>
 *
 * @author author
 * @since 2023-12-28
 */
@Api(tags = "聊天记录相关历史接口，已弃用")
@RestController
@RequestMapping("/chat-history")
@RequiredArgsConstructor
public class ChatHistoryController {
    private final IChatHistoryService chatService;

    @ApiOperation("新增提问")
    @PostMapping("/chat")
    public void saveReply(@Valid @RequestBody ChatDTO chatDTO) {
        chatService.saveReply(chatDTO);
    }


    @PostMapping
    @ApiOperation("langchain功能接口")
    public String  answerMyquestion(){
        return chatService.answerMyquestion();
    }

}
